"""
 This class provides logging facilities for the Athabaskan program. 
 - Jay Smit

"""


import threading
import logging

#Global log setup:
logging.basicConfig(level=logging.DEBUG,
                    format='%(asctime)s %(levelname)s %(message)s',
                    filename='Athabaskan.log',
                    filemode='w')

#Typically we write logs from all sorts of weird places
#hence we make sure this is threadsafe...
lock = threading.Lock()

def log_info(message):
    lock.acquire()
    logging.info(message)
    lock.release()

def log_warning(message):
    lock.acquire()
    logging.warning(message)
    lock.release()

def log_debug(message):
    lock.acquire()
    logging.debug(message)
    lock.release()
